Skip to content

Create or update records

Request

The API represents the main injection mechanism into the Data Platform. It allows records creation and/or update. When no record id is provided or when the provided id is not already present in the Data Platform then a new record is created. If the id is related to an existing record in the Data Platform then an update operation takes place and a new version of the record is created. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.

Security
bearer
Query
skipdupesboolean

Skip duplicates when updating records with the same value.

Headers
data-partition-idstringrequired

desired data partition id

Bodyapplication/json
Array [
idstring

Unique identifier in whole Data Platform. When not provided, Data Platform will create and assign an id to the record. Should follow the naming convention: {data-partition-id}:{object-type}:{uuid}.

Example:"slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1"
kindstringrequired

Kind of data it is being ingested. Must follow the naming convention: {authority/data-partition-id}:{source}:{entity-type}:{major}.{minor}.{patch}.

Example:"slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0"
aclobject(StorageAcl)required
Example:
{ "viewers": [ "data.default.viewers@{datapartition}.{domain}.com" ], "owners": [ "data.default.owners@{datapartition}.{domain}.com" ] }
legalobject(Legal)required
Example:
{ "legaltags": [ "slb-osdu-prod-des-prod-testing-sample-legaltag" ], "otherRelevantDataCountries": [ "US" ] }
dataobjectrequired

Record payload represented as a list of key-value pairs.

Example:
{ "msg": "hello world, from Data Platform" }
ancestryobject(RecordAncestry)
metaArray of objects(MetaBlock)

An array of elements collecting the frame of reference(FoR) information in records.

Example:
[ { "kind": "Unit", "persistableReference": "{\"scaleOffset\":{\"scale\":1.0,\"offset\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}", "propertyNames": [ … ], "name": "m" } ]
]
curl -i -X PUT \
  'https://as5.api.enterprisedata.slb.com/api/storage/v2/records?skipdupes=true' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'data-partition-id: string' \
  -d '[
    {
      "id": "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1",
      "kind": "slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0",
      "acl": {
        "viewers": [
          "data.default.viewers@{datapartition}.{domain}.com"
        ],
        "owners": [
          "data.default.owners@{datapartition}.{domain}.com"
        ]
      },
      "legal": {
        "legaltags": [
          "slb-osdu-prod-des-prod-testing-sample-legaltag"
        ],
        "otherRelevantDataCountries": [
          "US"
        ]
      },
      "data": {
        "msg": "hello world, from Data Platform"
      },
      "meta": [
        {
          "kind": "Unit",
          "persistableReference": "{\"scaleOffset\":{\"scale\":1.0,\"offset\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}",
          "propertyNames": [
            "ElevM"
          ],
          "name": "m"
        }
      ]
    }
  ]'

Responses

Records created and/or updated successfully.

Bodyapplication/json
recordCountinteger, (int32)

Number of records ingested successfully.

recordIdsArray of strings

List of ingested record id.

skippedRecordIdsArray of strings

List of record id that skipped update because it was a duplicate of the existing record.

Response
{ "recordCount": 0, "recordIds": [ "string" ], "skippedRecordIds": [ "string" ] }